package com.ktjiaoyu.service.impl;

import com.ktjiaoyu.mapper.NewsAdminMapper;
import com.ktjiaoyu.pojo.NewsAdmin;
import com.ktjiaoyu.service.NewsAdminService;
import com.ktjiaoyu.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

/**
 * @Author: DABINGCHNEGJIAO
 * @CreateTime: 2025-05-29
 * @Description:
 * @Version: 1.0
 */
@Service
public class NewsAdminServiceImpl implements NewsAdminService {
    @Autowired
    private NewsAdminMapper newsAdminMapper;

    @Override
    public R newsLogin(String username, String password) {
        NewsAdmin newsAdmin = newsAdminMapper.newsLogin(username, password);
        if (newsAdmin != null) {
            return R.ok(newsAdmin);
        } else {
            return R.fail("账号或密码错误!");
        }
    }
}
